﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WSManager.Model;
using FluentValidation;

namespace WSManager.ModelValidation
{
    public class WebFileValidator: AbstractValidator<WebFile>
    {
        public WebFileValidator()
        {
            RuleFor(f => f.Name).NotNull();
            RuleFor(f => f.Path).NotNull().When(f => f.Data == null);
            RuleFor(f => f.Data).NotNull().When(f => f.Path == null);
        }
    }
}
